package com.qf.ability.auth.controller;

import com.qf.ability.auth.service.AuthService;
import com.qf.data.auth.vo.WXAuthInput;
import com.qf.data.base.r.R;
import com.qf.data.base.r.Rs;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/auth/wx")
public class AuthController {

    @Autowired
    private AuthService authService;

    @RequestMapping("/login")
    public R wxLogin(@Valid WXAuthInput wxAuthInput){
        String jwtToken = authService.wxlogin(wxAuthInput);
        return Rs.create(jwtToken);
    }

//    @RequestMapping("/login")
//    public R wxLogin(String code,String nickname,String header ){
//        System.out.println("code:=====>"+code);
//        System.out.println("nickname:=====>"+nickname);
//        System.out.println("header:=====>"+header);
//
//        return Rs.create(null);
//    }
}
